package edu.smxy.associationmanagement.services.applytype.impl;

import edu.smxy.associationmanagement.domain.ApplyType;
import edu.smxy.associationmanagement.mapper.ApplyTypeMapper;
import edu.smxy.associationmanagement.services.applytype.ApplyTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * ApplyType 服务层接口实现类
 *
 * @date 2019/04/18
 * @author: : SDH
 * @description: 申请类型服务层接口实现类
 */
@Service("ApplyTypeService")
public class ApplyTypeServiceImpl implements ApplyTypeService {
  @Autowired ApplyTypeMapper applyTypeMapper;
  /**
   * 根据id删除ApplyType数据
   *
   * @param id id
   * @return 数据库受影响的行数
   */
  @Override
  public int deleteByPrimaryKey(Integer id) {
    return applyTypeMapper.deleteByPrimaryKey(id);
  }

  /**
   * 插入ApplyType数据
   *
   * @param record ApplyType对象
   * @return 数据库受影响的行数
   */
  @Override
  public int insert(ApplyType record) {
    return applyTypeMapper.insert(record);
  }

  /**
   * 安全插入ApplyType数据
   *
   * @param record ApplyType对象
   * @return 数据库受影响的行数
   */
  @Override
  public int insertSelective(ApplyType record) {
    return applyTypeMapper.insertSelective(record);
  }

  /**
   * 根据id查询ApplyType
   *
   * @param id id
   * @return 查询到的ApplyType数据
   */
  @Override
  public ApplyType selectByPrimaryKey(Integer id) {
    return applyTypeMapper.selectByPrimaryKey(id);
  }

  /**
   * 安全更新ApplyType数据
   *
   * @param record ApplyType对象
   * @return 数据库受影响的行数
   */
  @Override
  public int updateByPrimaryKeySelective(ApplyType record) {
    return applyTypeMapper.updateByPrimaryKeySelective(record);
  }


  /**
   * 更新ApplyType数据
   *
   * @param record ApplyType对象
   * @return 数据库受影响的行数
   */
  @Override
  public int updateByPrimaryKey(ApplyType record) {
    return applyTypeMapper.updateByPrimaryKey(record);
  }

  /**
   * 根据ApplyType的id判断是否在申请时间内
   *
   * @param id id
   * @return 在时间段内的ApplyType对象
   */
  @Override
  public ApplyType isInTime(Integer id) {
    return applyTypeMapper.isInTime(id);
  }

  /**
   * 根据ApplyType的id获取模板文件
   *
   * @param applytype id
   * @return ApplyType对象
   */
  @Override
  public ApplyType getTemplateFileById(Integer applytype) {
    return applyTypeMapper.getTemplateFileById(applytype);
  }
}
